package com.bbs.util;

public class constant {
    /**
     * 帖子类
     */
    //更新锁
    public static final String LOCK_UPDATE_POST = "lock:post:";
    //帖子缓存key前缀   +id
    public static final String POST_CACHE_KEY = "key:post:";
    //缓存空对象时间
    public static final Long POST_NULL_TIME = 60L;
    //帖子缓存时间
    public static final Long POST_CACHE_TIME = 24L;

    /**
     * 用户类
     */
    //用户登录token过期时间（天）
    public static final Long LOGIN_USER_TTL = 48L;
    //获取验证码key前缀
    public static final String CODE_PRE_KEY = "login:phone:";
    //验证码存储时间（秒）
    public static final Long CODE_TIME = 60L;
    //用户token前缀
    public static final String TOKEN_PRE = "user:token:";
    //用户名默认前缀
    public static final String USER_NAME_PRE = "user_";
    //token名
    public static final String LOGIN_TOKEN_NAME="login-token";
    //用户签到key
    public static final String USER_LOGIN="user:login";
    
    //TODO: 考虑添加以下配置
    //用户登录失败次数限制
    //public static final Integer MAX_LOGIN_FAIL_COUNT = 5;
    //用户登录失败锁定时间（分钟）
    //public static final Long LOGIN_FAIL_LOCK_TIME = 30L;
    //用户token黑名单前缀
    //public static final String TOKEN_BLACKLIST_PRE = "user:token:blacklist:";

    /**
     * 点赞类
     */
    //点赞锁前缀
    public static final String CREATE_LIKE_LOCK = "create:like:lock";
    //最大重试次数
    public static final Long MAX_RUN_COUNT = 3L;
    //获取锁的可等待时间（毫秒）
    public static final Long TRY_WAIT_MAX_TIME = 500L;
    //点赞锁的存储时间（毫秒）
    public static final Long LIKE_LOCK_TIME = 1000L;
    //点赞缓存key
    public static final String LIKE_CACHE_KEY="like:cache:key";

    /**
     * 关注
     */
    public static final String FOLLOW_USER_ID= "follow_user_id";

    //收件箱id
    public static final String FEED_POST_BOX="feed:post:box";

    //feed流
    public static final String FEED_KEY="feed:key";

    //feed流分页查询每次查询个数
    public static final Long FEED_COUNT=2L;
}
